<template>
    <div>
        <h1 v-text="msg" ref="title"></h1>
        <button ref="btn" @click="showDOM">点我输出上方元素的DOM</button>
        <School ref="sch"></School>
    </div>
</template>

<script>
import School from "./components/School.vue";
export default {
    name: "App",
    data() {
        return {
            msg: "欢迎嗷",
        };
    },
    components: {
        School,
    },
    methods: {
        showDOM() {
            console.log(this.$refs.title); //真实DOM
            console.log(this.$refs.btn); //真实DOM
            console.log(this.$refs.sch); //School组件的实例对象（vc）
        },
    },
};
</script>

<style>
</style>